package com.unitop.partner.entity.wmsToQimen;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

import com.unitop.partner.common.otms.OTMSJaxbXmlConverter;

public class TestWMS {
	public static void main(String[] args) {
		
		/** 在转换的实体类上添加 
		 * @XmlAccessorType(XmlAccessType.FIELD)
		   @XmlRootElement(name = "DeliveryorderQueryRequest")
		 */
	
		
		// xml字符串转 Javabean 
		
		 String retXml="<DeliveryorderQueryRequest><deliveryOrderId>2</deliveryOrderId>"
	        		+ "<orderId>555</orderId></DeliveryorderQueryRequest>";
		 
		 DeliveryorderQueryRequest convertToJavaBean = OTMSJaxbXmlConverter.convertToJavaBean(retXml, DeliveryorderQueryRequest.class);
		 System.out.println(convertToJavaBean.getOrderId());
		 // javabean 转 xml 字符串  
		 DeliveryorderQueryRequest qq=new DeliveryorderQueryRequest();
		 qq.setOrderId("456");
		 String t=OTMSJaxbXmlConverter.convertToXml(qq);
		 System.out.println(t);
		
	}

}
